<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="shortcut icon" href="favicon.ico"> <link href="./src/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
        <link href="./src/css/font-awesome.css?v=4.4.0" rel="stylesheet">
        <link href="./src/css/plugins/iCheck/custom.css" rel="stylesheet">
        <link href="./src/css/animate.css" rel="stylesheet">
        <link href="./src/css/style.css?v=4.1.0" rel="stylesheet">
        <link href="./src/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
        <script src="./src/js/My97DatePicker/WdatePicker.js"></script>
    </head>
    <body>
        <div class="ibox-content">
            <form class="form-horizontal">
                <input type="hidden" name="m" value="finance">
                <input type="hidden" name="a" value="overview">
                <div class="form-group">
                    <label class="col-sm-1 control-label" style="width: 100px;">公司信息：</label>

                    <div class="col-sm-2">
                        <select class="form-control m-b"  style="padding-top:2px;">
                            <option value='0' >全部</option>
                        </select>
                    </div>
                    <label class="col-sm-1 control-label" style="width: 100px;">汇总对象：</label>

                    <div class="col-sm-2">
                        <select class="form-control m-b" style="padding-top:2px;">
                            <option value='0'>全部</option>
                        </select>
                    </div>
                    <label class="col-sm-1 control-label" style="width: 125px;">客户：</label>

                    <div class="col-sm-2">
                        <select class="form-control m-b" name="custom_id"  style="padding-top:2px;">
                            <option>全部</opiton>
                                <?php
                                foreach ($this->csutom as $k => $v) {
                                    ?>
                                <option value="<?php echo $v['id'] ?>" <?php echo($this->custom_id == $v['id']) ? 'selected' : '' ?> ><?php echo $v['name'] ?></option>
                            <?php } ?>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" style="width: 100px;">车队：</label>

                    <div class="col-sm-2">
                        <select class="form-control m-b" name="carteam_id"  style="padding-top:2px;">
                            <option value='0' >全部</option>
                            <?php foreach ($this->carteam as $k => $v) { ?>
                                <option value="<?php echo $v['id'] ?>" <?php echo ($this->carteam_id == $v['id']) ? 'selected' : '' ?> ><?php echo $v['name'] ?></option>
                            <?php } ?>
                        </select>
                    </div>
                    <label class="col-sm-1 control-label" style="width: 100px;">车牌：</label>

                    <div class="col-sm-2">
                        <select class="form-control m-b"  name="car_id" style="padding-top:2px;">
                            <option value='0'>全部</option>
                            <?php foreach($this->car as $k=>$v){ ?>
                            <option value="<?php echo $v['id']; ?>" <?php echo ($this->car_id == $v['id']) ? 'selected':''; ?> ><?php echo $v['name']; ?></option>
                            <?php } ?>
                        </select>
                    </div>
                    <label class="col-sm-1 control-label" style="width: 125px;">司机：</label>

                    <div class="col-sm-2">
                        <select class="form-control m-b" name="driver_id"  style="padding-top:2px;">
                            <option value='0'>全部</option>
                            <?php foreach ($this->driver as $k => $v) { ?>
                                <option value="<?php echo $v['id'] ?>" <?php echo ($this->driver_id == $v['id']) ? 'selected' : '' ?> ><?php echo $v['name'] ?></option>
                            <?php } ?>
                        </select>
                    </div>

                    <!--                    <div class="col-sm-1">
                                            <button class="btn btn-sm btn-info" type="submit">搜索</button>
                                        </div>-->
                </div>
                <label class="col-sm-1 control-label" style="width: 100px;margin-left:-15px;">做箱时间：</label>
                <div class="form-group">
                    <div class="col-sm-4">
                        <div class="input-daterange input-group  m-b"  id="datepicker">
                            <input class="input-sm form-control" name="start" onfocus="WdatePicker({skin: 'whyGreen', dateFmt: 'yyyy-MM-dd'})" value="<?php echo $this->start ?>" type="text">
                            <span class="input-group-addon">到</span>
                            <input class="input-sm form-control" name="end" onfocus="WdatePicker({skin: 'whyGreen', dateFmt: 'yyyy-MM-dd'})" value="<?php echo $this->end ?>"  type="text">
                        </div>
                    </div>
                    <div class="col-sm-1">
                        <button class="btn btn-sm btn-info" type="submit">搜索</button>
                    </div>
                </div>
            </form>
        </div>
        <div class="row">
            <div class="ibox float-e-margins" style="width:98%;margin-left:1%;">
                <div class="ibox-title">
                    <button class="btn btn-success" style="margin-top:-10px;" type="button" id=""><span class="bold">预览</span></button>
                    <button class="btn btn-success" style="margin-top:-10px;" type="button" id="dao"><span class="bold">导出</span></button>    
                </div>
                <div class="ibox-content">

                    <table class="table table-bordered">
                        <thead>
                            <tr>
                                <th>序号</th>
                                <th>客户</th>
                                <th>箱量</th>
                                <th>扣除代垫费</th>
                                <th>扣除税金</th>
                                <th>扣除代收费</th>
                                <th>扣除预付费</th>
                                <th>扣除代支费</th>
                                <th>扣除代垫费(收)</th>
                                <th>扣除税金(收)</th>
                                <th>扣除垫付费</th>
                                <th>应收合计</th>
                                <th>已收金额</th>
                                <th>未收金额</th>
                                <th>应付合计</th>
                                <th>已付金额</th>
                                <th>未付金额</th>
                                <th>车辆成本</th>
                                <th>已付金额</th>
                                <th>未付金额</th>
                                <th>公司成本</th>
                                <th>已付金额</th>
                                <th>未付金额</th>
                                <th>公司利润</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                            $mcount = 0;
                            $mktotal1 = 0;
                            $mktotal2 = 0;
                            $mktotal3 = 0;
                            $mtotal1 = 0;
                            $mtotal2 = 0;
                            $mycount = 0;
                            $mfocunt = 0;
                            $mkcount = 0;
                            foreach ($this->data as $k => $v) {
                                ?>
                                <tr>
                                    <td><?php echo $k ?></td>
                                    <td><?php echo $v['name'] ?></td>
                                    <td><?php echo $v['count'];
                            $mcount += $v['count']; ?></td>
                                    <td><?php echo $v['ktotal1'];
                            $mktotal1 +=$v['ktotal1']; ?></td>
                                    <td><?php echo $v['ktotal2'];
                            $mktotal2 +=$v['ktotal2']; ?></td>
                                    <td>待支费</td>
                                    <td><?php echo $v['ktotal3'];
                            $mktotal3 += $v['ktotal3']; ?></td>
                                    <td>代收费</td>
                                    <td><?php echo $v['total1'];
                            $mtotal1 += $v['total1']; ?></td>
                                    <td><?php echo $v['total2'];
                            $mtotal2 += $v['total2']; ?></td>
                                    <td>垫付费</td>
                                    <td><?php 
                            echo $v['ycount'];
                            $mycount += $v['ycount']; ?></td>
                                    <td>已收金额</td>
                                    <td><?php echo $v['ycount'] ?></td>
                                    <td><?php 
                            echo $v['fcount'];
                            $mfocunt += $v['fcount']; ?></td>
                                    <td>已付金额</td>
                                    <td><?php echo $v['fcount'] ?></td>
                                    <td><?php 
                            echo $v['kcount'];
                            $mkcount += $v['kcount']; ?></td>
                                    <td>已付金额</td>
                                    <td><?php echo $v['kcount'] ?></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                </tr>
    <?php
}
?>
                            <tr style="background:#CEDFF5">
                                <td colspan="2" style="text-align:right;"><b>合计:</b></td>
                                <td><?php echo $mcount; ?></td>
                                <td><?php echo $mktotal1; ?></td>
                                <td><?php echo $mktotal2; ?></td>
                                <td></td>
                                <td><?php echo $mktotal3; ?></td>
                                <td></td>
                                <td><?php echo $mtotal1; ?></td>
                                <td><?php echo $mtotal2; ?></td>
                                <td></td>
                                <td><?php echo $mycount; ?></td>
                                <td></td>
                                <td><?php echo $mycount; ?></td>
                                <td><?php echo $mfocunt; ?></td>
                                <td></td>
                                <td><?php echo $mfocunt; ?></td>
                                <td><?php echo $mkcount; ?></td>
                                <td></td>
                                <td><?php echo $mkcount  ?></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                </tr>
                        </tbody>
                    </table>

                </div>
            </div>
        </div>
        <div class="admin-table-page" style="margin-left:20px;">
            <div id="page" class="page">
<?php echo $this->paging; ?>
            </div>
        </div>
        <div class="modal inmodal fade" id="myModal5" tabindex="-1" role="dialog"  aria-hidden="true">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h4 class="modal-title">车队信息新增</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal">
                            <div class="form-group">

                                <label class="col-sm-2 control-label">车队全称：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="name" name="account">
                                </div>
                                <label class="col-sm-2 control-label">车队编号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="code" name="account">
                                </div>

                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">车队简称：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="nickname" name="account">
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">地址：</label>
<!--                                  <textarea id="ccommen" name="comment" class="form-control" required="" aria-required="true">
    
                                  </textarea>-->

                                <div class="col-sm-8">
                                    <textarea id="address" name="comment" class="form-control" required="" aria-required="true"></textarea>
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">联系人：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="contact" name="account">
                                </div>
                                <label class="col-sm-2 control-label">联系电话：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="telephone" name="account">
                                </div>

                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">传真号码：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="fax" name="account">
                                </div>
                                <label class="col-sm-2 control-label">邮箱地址：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="email" name="account">
                                </div>

                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">税率：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="tax" name="account">
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">备注：</label>
                                <div class="col-sm-8">
                                    <textarea id="remark" name="comment" class="form-control" required="" aria-required="true"></textarea>
                                </div>
                            </div>

                        </form>
                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-white" id="gb" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary" id="baocun">保存</button>
                    </div>
                </div>
            </div>
        </div>


        <div class="modal inmodal fade" id="myModal6" tabindex="-1" role="dialog"  aria-hidden="true">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h4 class="modal-title">车队信息修改</h4>
                    </div>
                    <div class="modal-body">
                        <div class="modal-body">
                            <form class="form-horizontal">
                                <div class="form-group">

                                    <label class="col-sm-2 control-label">车队全称：</label>
                                    <div class="col-sm-3">
                                        <input class="form-control m-b" id="uname" name="account">
                                    </div>
                                    <label class="col-sm-2 control-label">车队编号：</label>
                                    <div class="col-sm-3">
                                        <input class="form-control m-b" id="ucode" name="account">
                                    </div>

                                </div>
                                <div class="form-group">

                                    <label class="col-sm-2 control-label">车队简称：</label>
                                    <div class="col-sm-3">
                                        <input class="form-control m-b" id="unickname" name="account">
                                    </div>
                                </div>
                                <div class="form-group">

                                    <label class="col-sm-2 control-label">地址：</label>
    <!--                                  <textarea id="ccommen" name="comment" class="form-control" required="" aria-required="true">
        
                                      </textarea>-->

                                    <div class="col-sm-8">
                                        <textarea id="uaddress" name="comment" class="form-control" required="" aria-required="true"></textarea>
                                    </div>
                                </div>
                                <div class="form-group">

                                    <label class="col-sm-2 control-label">联系人：</label>
                                    <div class="col-sm-3">
                                        <input class="form-control m-b" id="ucontact" name="account">
                                    </div>
                                    <label class="col-sm-2 control-label">联系电话：</label>
                                    <div class="col-sm-3">
                                        <input class="form-control m-b" id="utelephone" name="account">
                                    </div>

                                </div>
                                <div class="form-group">

                                    <label class="col-sm-2 control-label">传真号码：</label>
                                    <div class="col-sm-3">
                                        <input class="form-control m-b" id="ufax" name="account">
                                    </div>
                                    <label class="col-sm-2 control-label">邮箱地址：</label>
                                    <div class="col-sm-3">
                                        <input class="form-control m-b" id="uemail" name="account">
                                    </div>

                                </div>
                                <div class="form-group">

                                    <label class="col-sm-2 control-label">税率：</label>
                                    <div class="col-sm-3">
                                        <input class="form-control m-b" id="utax" name="account">
                                    </div>
                                </div>
                                <div class="form-group">

                                    <label class="col-sm-2 control-label">备注：</label>
                                    <div class="col-sm-8">
                                        <textarea id="uremark" name="comment" class="form-control" required="" aria-required="true"></textarea>
                                    </div>
                                </div>

                            </form>
                        </div>
                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-white" id="gb" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary" id="ubaocun">保存</button>
                    </div>
                </div>
            </div>
        </div>
        <script type="text/javascript" src="./src/js/plugins/layui/layui.js"></script>
        <script src="./src/js/jquery.min.js?v=2.1.4"></script>
        <script src="./src/js/bootstrap.min.js?v=3.3.6"></script>
        <script src="./src/js/content.js?v=1.0.0"></script>
        <script src="./src/js/plugins/sweetalert/sweetalert.min.js"></script>
        <script>
        $(function(){
            $("#dao").click(function(){
              location.href = "./?m=finance&a=overview&type=2";
            });
        });
        </script>
    </body>
</html>
